package com.i2863.receiptinterface.service.impl;

import com.i2863.receiptinterface.entity.Account;
import com.i2863.receiptinterface.mapper.AccountMapper;
import com.i2863.receiptinterface.service.AccountService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountMapper accountMapper;

    @Override
    public Account findOne(Integer Id) {
        return accountMapper.selectByPrimaryKey(Id);
    }

    @Override
    public List<Account> findAll() {
        return accountMapper.selectAll();
    }

    @Override
    public void update(Account account) {
        accountMapper.updateByPrimaryKey(account);
    }

    @Override
    public void delete(Integer Id) {
        accountMapper.deleteByPrimaryKey(Id);
    }

    @Override
    public void add(Account account) {
        accountMapper.insert(account);
    }
}
